package fr.form;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="ta_application")
public class Application{

	@Id
	@GeneratedValue
	private Integer id;
	
	private String libelle;
	
	private String lien;
	
	private String image;

	private BigDecimal montant;

	@Column(name="statut_Application")
	private Integer statutApplication;

	private String question;
	private String proposition1;
	private String proposition2;
	private String proposition3;
	private String proposition4;
	private Integer reponse;

	@Column(name="date_Create")
	private Date dateCreate;

	@ManyToOne( targetEntity=StatutApplication.class, fetch=FetchType.EAGER)
	@JoinColumn(name="statut_application",nullable=true, insertable=false,updatable=false,referencedColumnName="valeur")
	private StatutApplication statutApplicationObj;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
	private Set<Participation> participations = new HashSet<Participation>();

	public Set<Participation> getParticipations() {
		return participations;
	}

	public void setParticipations(Set<Participation> pParticipations) {
		this.participations = pParticipations;
	}

	public Application() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getLibelle() {
		return this.libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	public String getImage() {
		return this.image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public BigDecimal getMontant() {
		return this.montant;
	}

	public void setMontant(BigDecimal montant) {
		this.montant = montant;
	}

	public Integer getStatutApplication() {
		return this.statutApplication;
	}

	public void setStatutApplication(Integer statutApplication) {
		this.statutApplication = statutApplication;
	}

	public StatutApplication getStatutApplicationObj() {
		return statutApplicationObj;
	}

	public void setStatutApplicationObj(StatutApplication statutApplicationObj) {
		this.statutApplicationObj = statutApplicationObj;
	}

	public Date getDateCreate() {
		return dateCreate;
	}

	public void setDateCreate(Date dateCreate) {
		this.dateCreate = dateCreate;
	}

	public String getLien() {
		return lien;
	}

	public void setLien(String lien) {
		this.lien = lien;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getProposition1() {
		return proposition1;
	}

	public void setProposition1(String proposition1) {
		this.proposition1 = proposition1;
	}

	public String getProposition2() {
		return proposition2;
	}

	public void setProposition2(String proposition2) {
		this.proposition2 = proposition2;
	}

	public String getProposition3() {
		return proposition3;
	}

	public void setProposition3(String proposition3) {
		this.proposition3 = proposition3;
	}

	public String getProposition4() {
		return proposition4;
	}

	public void setProposition4(String proposition4) {
		this.proposition4 = proposition4;
	}

	public Integer getReponse() {
		return reponse;
	}

	public void setReponse(Integer reponse) {
		this.reponse = reponse;
	}
	
	

}
